import service from "@/utils/request";
const DEPT_BASE_URL = "/api/";

//羊只体尺列表
class BodyMeasure {
  static getBodyMeasureList(queryParams?: getBodyMeasure) {
    return service<any, getBodyMeasure>({
      url: `${DEPT_BASE_URL}BodyMeasureModel/BodyMeasureModelList`,
      method: "post",
      data: queryParams,
    });
  }
  //羊只品种
  static BodyMeasureVarity() {
    return service({
      url: `${DEPT_BASE_URL}EarTage/ShowEarTageBreed`,
      method: "get",
    });
  }

  //删除体尺
  static DeleteBodyMeasure(bodyMeasureId: number[]) {
    return service<any, any>({
      url: `${DEPT_BASE_URL}BodyMeasureModel/DeleteBodyMeasureModel`,
      method: "post",
      data: bodyMeasureId,
    });
  }

  ///体尺添加
  static AddBodyMeasure(data: AddMeasure) {
    return service({
      url: `${DEPT_BASE_URL}BodyMeasureModel/AddBodyMeasureModel`,
      method: "post",
      data,
    });
  }

  //体尺修改
  static UpdateBodyMeasure(data: AddMeasure) {
    return service({
      url: `${DEPT_BASE_URL}BodyMeasureModel/UpdateBodyMeasureModel`,
      method: "post",
      data: data,
    });
  }

  //耳号列表
  static MeasureEarTagLisShow(presentState: any, sheepType: any) {
    return service({
      url: `${DEPT_BASE_URL}SheepFileModels/IsSexSheepfilemodel`,
      method: "get",
      params: {
        presentState: presentState,
        sheepType: sheepType,
      },
    });
  }
}

export default BodyMeasure;

export interface getBodyMeasure {
  pageIndex: number;
  pageSize: number;
  earTag: string;
  variety: number;
  sheepRescissionSex: boolean;
}

export interface AddMeasure {
  bodyMeasureId: number;
  earTag: string;
  measureDate: any;
  height: number;
  bodyLength: number;
  chest: number;
  tube: number;
  oschea: number;
  backfat: number;
  eyeMuscleArea: number;
  eyeMuscleWidth: number;
}
